# @time     :2022/2/19
# @Author   :Simple
# @FileName :config
import logging
import os


def init_dir(path, file_name):
    """
    初始化目录
    """
    if not os.path.exists(os.path.join(path, file_name)):
        os.mkdir(os.path.join(path, file_name))
    return os.path.join(path, file_name)


BASE_DIR = os.path.dirname(os.path.abspath(__file__))
LOG_DIR = init_dir(BASE_DIR, 'logs')
SELENIUM_LOG = init_dir(LOG_DIR, "selenium")
RUN_LOG = init_dir(LOG_DIR, "run")
REPORT_DIR = init_dir(BASE_DIR, "report")
IMAGE_REPORT = init_dir(REPORT_DIR, "image")
CAPABILITIES_DIR = init_dir(BASE_DIR, "settings")
BASE_CAPS_DIR = os.path.join(CAPABILITIES_DIR, 'base_driver.yaml')
# 日志类型
log_level = logging.DEBUG
# 测试用例脚本路径
cases_path = os.path.join(BASE_DIR, "qyex/testcase/")
# selenium_grid server的jar包和node文件
server_path = os.path.join(BASE_DIR, "data/selenium-grid/selenium-server-standalone-3.141.59.jar")
node_path = os.path.join(BASE_DIR, "data/selenium-grid/node3.json")
